package com.niiwoo.civet.trade.enums;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 标的申请流程执行表-节点执行状态:0-处理中，1-异常'
 */
@Getter
@AllArgsConstructor
public enum ProjectFlowExecuteRuntimeNodeStatusEnum {

	HANDING((byte)0, "处理中"),
	EXCEPTION((byte)1, "异常")

	;

	private Byte status;
	private String desc;

	public static ProjectFlowExecuteRuntimeNodeStatusEnum enumOf(Byte status) {
		for (ProjectFlowExecuteRuntimeNodeStatusEnum statusEnum : values()) {
			if (statusEnum.status.equals(status)) {
				return statusEnum;
			}
		}
		throw new NoSuchEnumValueException("ProjectFlowExecuteRuntimeNodeStatusEnum:" + status);
	}

	public static String getDesc(Byte status){
		for (ProjectFlowExecuteRuntimeNodeStatusEnum statusEnum : values()) {
			if (statusEnum.status.equals(status)) {
				return statusEnum.desc;
			}
		}
		return null;
	}
}
